package system

import "github.com/gogf/gf/v2/frame/g"

type PermissionCreateReq struct {
	g.Meta   `path:"/system/permission/create" tags:"系统管理-权限" method:"post" summary:"新增" description:"新增权限项，权限项存储有权限调用的API路由，可存储多条API路由信息，用户通过关联角色，角色可以直接关联权限项，也可以间接通过菜单栏关联权限项，使其用户有权限访问API"`
	Type     int    `v:"required" dc:"类型：1-菜单栏menu；2-按钮action；"`
	ParentId int64  `v:"required" dc:"上级ID"`
	Name     string `v:"required" dc:"名称"`
	Code     string `v:"required" dc:"标识符"`
	Routes   string `v:"" dc:"路由信息"`
	Sort     int    `v:"required" dc:"序号"`
	Memo     string `v:"" dc:"备注"`
}
type PermissionCreateRes struct {
	Id int64 `json:"id"`
}

type PermissionUpdateReq struct {
	g.Meta   `path:"/system/permission/update" tags:"系统管理-权限" method:"post" summary:"修改" description:"修改权限项"`
	Id       int64  `v:"required"`
	Type     int    `v:"required" dc:"类型：1-菜单栏menu；2-按钮action；"`
	ParentId int64  `v:"required" dc:"上级ID"`
	Name     string `v:"required" dc:"名称"`
	Code     string `v:"required" dc:"标识符"`
	Routes   string `v:"" dc:"路由信息"`
	Sort     int    `v:"required" dc:"序号"`
	Memo     string `v:"" dc:"备注"`
}
type PermissionUpdateRes struct{}

type PermissionDeleteReq struct {
	g.Meta `path:"/system/permission/delete" tags:"系统管理-权限" method:"post" summary:"删除" description:"删除权限项"`
	Id     int64 `v:"required"`
}
type PermissionDeleteRes struct{}

type PermissionTreeReq struct {
	g.Meta `path:"/system/permission/tree" tags:"系统管理-权限" method:"get" summary:"列表数据" description:"返回树形结构的权限数据"`
}
type PermissionTreeRes struct {
	Tree interface{} `json:"tree"`
}
